package com.qzsoft.zhjd.machine.modules.machinedriver.entity;

import java.util.Date;

import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.qzsoft.jeemis.common.validator.group.AddGroup;
import com.qzsoft.jeemis.common.validator.group.UpdateGroup;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

/**
 * @ClassName MachineDriverEntity
 * @Description 驾驶员
 * @author linhuawei
 * @since 2021-10-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("machine_driver")
public class MachineDriverEntity {

    /**
     * 主键
     */
    @NotBlank(groups = UpdateGroup.class, message = "标识不可为空")
    private String id;

    /**
     * 姓名
     */
    @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "姓名不可为空")
    @Length(groups = {AddGroup.class, UpdateGroup.class}, max = 20, message = "姓名不可超过{max}个字")
    private String name;

    /**
     * 电话
     */
    @NotBlank(groups = {AddGroup.class, UpdateGroup.class}, message = "电话不可为空")
    private String phone;

    /**
     * 身份证
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String idCard;

    /**
     * 驾驶证
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String driverCard;

    /**
     * 从业资格证
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String practiseCard;

    /**
     * 操作证
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String operateCard;

    /**
     * 创建者
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Long creator;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT, updateStrategy = FieldStrategy.NEVER)
    private Date createDate;

    /**
     * 更新者
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Long updater;

    /**
     * 更新时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Date updateDate;

}
